#include <stdio.h>
#include "os_define.h"
#include "ostypes.h"
#include "syncsocket.h"

int main(int argc, char* argv[])
{
#ifdef WIN32
	WSADATA wsa;
	memset(&wsa, 0, sizeof (wsa));
	WSAStartup(0, &wsa);
	WSAStartup(wsa.wHighVersion, &wsa);
#endif

	char sz[1024];
	strcpy(sz, "GET /shop/shop_querybalance?skyid=1234 HTTP/1.1\r\nHost: www.52le.com\r\nCookie: AAA=123;BBB=456;JSESSIONID=superman007\r\n\r\n");
	CSyncSocket socket;
	socket.Create();
	if(!socket.Connect("172.16.3.158", 8700))
	{
		printf("connect failed! \r\n");
		return 0;
	}
	printf("connect succ \r\n");

	int nSend = socket.Send((PBYTE)sz, strlen(sz));
	printf("send succ %d\r\n", nSend);

	BYTE buf[8192];
	int nRecv = socket.Receive(buf, 8192, 120*1000);
	socket.Close();
	printf("recv:%d \r\n", nRecv);
}


